﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media.Imaging;

namespace Mengsk.ERP.Orders
{
    public class OrderImageUtil
    {
        public static readonly BitmapSource IMAGE_RED = new BitmapImage(new Uri("/Mengsk.ERP;component/Orders/Images/Red.jpg", UriKind.Relative));
        public static readonly BitmapSource IMAGE_GREEN = new BitmapImage(new Uri("/Mengsk.ERP;component/Orders/Images/Green.jpg", UriKind.Relative));
        public static readonly BitmapSource IMAGE_YELLOW = new BitmapImage(new Uri("/Mengsk.ERP;component/Orders/Images/Yellow.jpg", UriKind.Relative));
        public static readonly BitmapSource IMAGE_BLUE = new BitmapImage(new Uri("/Mengsk.ERP;component/Orders/Images/Blue.jpg", UriKind.Relative));
        public static readonly BitmapSource IMAGE_PINK = new BitmapImage(new Uri("/Mengsk.ERP;component/Orders/Images/Pink.jpg", UriKind.Relative));
        public static readonly BitmapSource IMAGE_UN_LABLE = new BitmapImage(new Uri("/Mengsk.ERP;component/Orders/Images/None.jpg", UriKind.Relative));

        public static BitmapSource Convert(OrderFlag flag)
        {
            if (flag == OrderFlag.UN_LABEL)
            {
                return IMAGE_UN_LABLE;
            }

            if (flag == OrderFlag.BLUE)
            {
                return IMAGE_BLUE;
            }

            if (flag == OrderFlag.GREEN)
            {
                return IMAGE_GREEN;
            }

            if (flag == OrderFlag.PINK)
            {
                return IMAGE_PINK;
            }

            if (flag == OrderFlag.RED)
            {
                return IMAGE_RED;
            }

            if (flag == OrderFlag.YELLOW)
            {
                return IMAGE_YELLOW;
            }

            throw new ArgumentException(flag.ToString());
        }
    }
}
